package com.example.exampleOS.slice;

import com.example.exampleOS.ResourceTable;
import com.example.netimage.NetImage;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.DirectionalLayout;

public class NetImageSlice extends AbilitySlice {
    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_net_image_slice);
        NetImage netImage = new NetImage(this
                , "https://img2.baidu.com/it/u=4235011065,2532143354&fm=26&fmt=auto");
        DirectionalLayout netImageSlice =(DirectionalLayout) findComponentById(ResourceTable.Id_netImageSlice);
        netImage.setWidth(DirectionalLayout.LayoutConfig.MATCH_PARENT);
        netImageSlice.addComponent(netImage);
    }

    @Override
    protected void onActive() {
        super.onActive();
    }

    @Override
    protected void onInactive() {
        super.onInactive();
    }

    @Override
    protected void onForeground(Intent intent) {
        super.onForeground(intent);
    }

    @Override
    protected void onBackground() {
        super.onBackground();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}
